
import java.util.Vector;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Laurens
 */
public class ErrorMessages 
{
    /**
     * Default constructor does nothing
     */
    public ErrorMessages()
    {
        //DOES NOTHING
    }
    
    /**
     * Returns the list of all possible error messages
     * @return 
     */
    public String getErrorMessages(String type)
    {
        int option = determineNumber(type);
        Vector<String> result = new Vector<String>();
        /*0*/result.add("Error, location path cannot be found!\n");
        /*1*/result.add("Error, you may not use that value, it is a special java word!\nPlease try another one.");
        /*2*/result.add("Error, you may not use that value, it is already used in you program!\nPlease try another one.");
        /*3*/result.add("Error, you may not use that value, punctuation values are not allowed!\nPlease try another one.");
        /*4*/result.add("Error, that is not a valid value to refactor this way!!");
        /*5*/result.add("Error, that value has not been found in your current text.\nPlease try a different value.");
        /*6*/result.add("Error, try and catch failed");
        /*7*/result.add("Error, unable to do refactoring. Please contact administrator");
        String output = result.get(option);
        return output;
    }

    public int determineNumber(String type) 
    {
        if("pathNotFound".equals(type))
        {
            return 0;
        }
        else if("keyword".equals(type))
        {
            return 1;
        }
        else if("alreadyUsed".equals(type))
        {
            return 2;
        }
        else if("punctuation".equals(type))
        {
            return 3;
        }
        else if("invalid".equals(type))
        {
            return 4;
        }
        else if("notFound".equals(type))
        {
            return 5;
        }
        else if("tryFailed".equals(type))
        {
            return 6;
        }
        else
        {
            return 7;
        }
    }
}
